import {getCartList} from '../api/cart'
async function getBadge(){
  var res=await getCartList(wx.getStorageSync("token"));
  if(res.data.code==0){
      wx.setTabBarBadge({
        index: 3,
        text: ''+res.data.data.number,
      })
  }else{
      wx.removeTabBarBadge({
        index: 3
      })
  }
}
export default {
  getBadge:getBadge
}